<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>添加题目 - 智慧题库</title>
    <link href="../assets/css/tailwind.css" rel="stylesheet">
    <link href="../assets/css/font-awesome.min.css" rel="stylesheet">
</head>
<body class="font-inter bg-gray-50 min-h-screen flex flex-col bg-education">
    <!-- 背景装饰元素 -->
    <div class="absolute inset-0 overflow-hidden -z-10">
        <div class="absolute top-10 left-10 w-40 h-40 rounded-full bg-primary/10 animate-float">
            <div class="w-full h-full flex items-center justify-center text-primary/20 text-6xl education-icon">
                <i class="fa fa-plus"></i>
            </div>
        </div>
        <div class="absolute bottom-20 right-20 w-60 h-60 rounded-full bg-secondary/10 animate-float" style="animation-delay: -2s">
            <div class="w-full h-full flex items-center justify-center text-secondary/20 text-7xl education-icon">
                <i class="fa fa-question-circle"></i>
            </div>
        </div>
    </div>

    <!-- 顶部导航栏 -->
    <header class="sticky top-0 z-50 bg-white/90 backdrop-blur-sm shadow-sm transition-all duration-300">
        <div class="container mx-auto px-4 py-3 flex items-center justify-between">
            <div class="flex items-center space-x-2">
                <div class="w-10 h-10 bg-primary/10 rounded-xl flex items-center justify-center text-primary">
                    <i class="fa fa-question-circle"></i>
                </div>
                <h1 class="text-xl font-bold text-dark ml-0 md:ml-[-2rem]">智慧题库管理系统</h1>
            </div>
            
            <!-- 顶部导航 -->
            <div class="hidden md:flex items-center space-x-2">
                <a href="AdminDashboard.html" class="nav-item">
                    <i class="fa fa-home mr-2"></i> 控制面板
                </a>
                <a href="QuestionManagement.html" class="nav-item active">
                    <i class="fa fa-book mr-2"></i> 题库管理
                </a>
                <a href="ExamManagement.html" class="nav-item">
                    <i class="fa fa-graduation-cap mr-2"></i> 考试管理
                </a>
                <a href="TextbookVersionList.html" class="nav-item">
                    <i class="fa fa-archive mr-2"></i> 教材管理
                </a>
                <a href="StatisticsAnalysis.html" class="nav-item">
                    <i class="fa fa-bar-chart mr-2"></i> 数据分析
                </a>
                <a href="SystemSettings.html" class="nav-item">
                    <i class="fa fa-cog mr-2"></i> 系统设置
                </a>
            </div>
            
            <div class="flex items-center space-x-4">
                <button class="p-2 text-muted hover:text-primary transition-colors relative">
                    <i class="fa fa-bell"></i>
                    <span class="absolute top-1 right-1 w-2 h-2 bg-accent rounded-full"></span>
                </button>
                <div class="flex items-center space-x-2">
                    <img src="https://picsum.photos/id/64/40/40" alt="用户头像" class="w-8 h-8 rounded-full object-cover border-2 border-primary/20">
                    <span class="hidden md:inline text-sm font-medium text-dark">张老师</span>
                    <i class="fa fa-angle-down text-muted"></i>
                </div>
                <button class="md:hidden p-2 text-muted hover:text-primary transition-colors" id="mobile-menu-button">
                    <i class="fa fa-bars"></i>
                </button>
            </div>
        </div>
    </header>

    <!-- 主内容区 -->
    <main class="flex-grow flex">
        <!-- 左侧导航栏 -->
        <aside id="sidebar" class="w-64 bg-sidebar-bg shadow-sidebar transition-all duration-300 h-[calc(100vh-64px)] sticky top-[64px] overflow-y-auto">
            <!-- 题库管理菜单 -->
            <div class="p-4 border-b border-gray-200">
                <h3 class="text-sm font-medium text-muted uppercase tracking-wider">题库管理</h3>
            </div>
            <div class="p-2">
                <a href="QuestionManagement.html" class="sidebar-item">
                    <i class="fa fa-list-alt"></i>
                    <span>题目列表</span>
                </a>
                <div class="sidebar-item active">
                    <i class="fa fa-plus-circle"></i>
                    <span>添加题目</span>
                </div>
                <a href="QuestionCategory.html" class="sidebar-item">
                    <i class="fa fa-folder"></i>
                    <span>题目分类</span>
                </a>
                <a href="QuestionTags.html" class="sidebar-item">
                    <i class="fa fa-tags"></i>
                    <span>标签管理</span>
                </a>
                <a href="QuestionPending.html" class="sidebar-item">
                    <i class="fa fa-flag"></i>
                    <span>待审核题目</span>
                </a>
            </div>
        </aside>

        <!-- 内容区域 -->
        <div class="flex-grow p-6">
            <!-- 页面标题 -->
            <div class="mb-8">
                <div class="flex items-center justify-between">
                    <div>
                        <h2 class="text-[clamp(1.5rem,3vw,2rem)] font-bold text-dark">添加题目</h2>
                        <p class="text-muted mt-2">创建新的题目，设置题目类型、难度、分类和答案</p>
                    </div>
                    <div class="flex space-x-3">
                        <button class="px-4 py-2 bg-white border border-gray-300 text-dark rounded-lg shadow-sm hover:bg-gray-50 transition-colors">
                            <i class="fa fa-eye mr-2"></i>预览
                        </button>
                        <button class="px-4 py-2 bg-primary text-white rounded-lg shadow-sm hover:bg-primary/90 transition-colors">
                            <i class="fa fa-save mr-2"></i>保存题目
                        </button>
                    </div>
                </div>
            </div>
            
            <!-- 表单内容区 -->
            <div class="grid grid-cols-1 lg:grid-cols-3 gap-6">
                <!-- 左侧：题目基本信息 -->
                <div class="lg:col-span-2 space-y-6">
                    <!-- 基本信息表单 -->
                    <div class="bg-white rounded-2xl p-6 shadow-card">
                        <h3 class="text-lg font-bold text-dark mb-6 flex items-center">
                            <i class="fa fa-info-circle text-primary mr-2"></i>基本信息
                        </h3>
                        
                        <div class="grid grid-cols-1 md:grid-cols-2 gap-6">
                            <div>
                                <label class="block text-sm font-medium text-muted mb-1">题目类型 *</label>
                                <select class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-primary/50">
                                    <option value="">请选择题目类型</option>
                                    <option value="single">单选题</option>
                                    <option value="multiple">多选题</option>
                                    <option value="fill">填空题</option>
                                    <option value="essay">简答题</option>
                                    <option value="calculation">计算题</option>
                                </select>
                            </div>
                            
                            <div>
                                <label class="block text-sm font-medium text-muted mb-1">难度等级 *</label>
                                <select class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-primary/50">
                                    <option value="">请选择难度</option>
                                    <option value="easy">简单</option>
                                    <option value="medium">中等</option>
                                    <option value="hard">困难</option>
                                </select>
                            </div>
                            
                            <div>
                                <label class="block text-sm font-medium text-muted mb-1">所属分类 *</label>
                                <select class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-primary/50">
                                    <option value="">请选择分类</option>
                                    <option value="math">数学</option>
                                    <option value="physics">物理</option>
                                    <option value="chemistry">化学</option>
                                    <option value="biology">生物</option>
                                </select>
                            </div>
                            
                            <div>
                                <label class="block text-sm font-medium text-muted mb-1">知识点 *</label>
                                <select class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-primary/50">
                                    <option value="">请选择知识点</option>
                                    <option value="set">集合</option>
                                    <option value="function">函数</option>
                                    <option value="trigonometry">三角函数</option>
                                </select>
                            </div>
                            
                            <div>
                                <label class="block text-sm font-medium text-muted mb-1">分值</label>
                                <input type="number" placeholder="如：5" class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-primary/50">
                            </div>
                            
                            <div>
                                <label class="block text-sm font-medium text-muted mb-1">预计用时（分钟）</label>
                                <input type="number" placeholder="如：3" class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-primary/50">
                            </div>
                        </div>
                        
                        <div class="mt-6">
                            <label class="block text-sm font-medium text-muted mb-1">题目标签</label>
                            <div class="flex flex-wrap gap-2 p-3 border border-gray-300 rounded-lg min-h-[60px]">
                                <span class="px-3 py-1 bg-primary/10 text-primary rounded-full text-sm flex items-center">
                                    集合
                                    <i class="fa fa-times ml-2 cursor-pointer"></i>
                                </span>
                                <span class="px-3 py-1 bg-secondary/10 text-secondary rounded-full text-sm flex items-center">
                                    基础题
                                    <i class="fa fa-times ml-2 cursor-pointer"></i>
                                </span>
                                <input type="text" placeholder="输入标签后按回车添加" class="flex-1 min-w-[200px] border-none outline-none bg-transparent">
                            </div>
                        </div>
                    </div>
                    
                    <!-- 题目内容 -->
                    <div class="bg-white rounded-2xl p-6 shadow-card">
                        <h3 class="text-lg font-bold text-dark mb-6 flex items-center">
                            <i class="fa fa-edit text-primary mr-2"></i>题目内容
                        </h3>
                        
                        <div class="space-y-4">
                            <div>
                                <label class="block text-sm font-medium text-muted mb-1">题目题干 *</label>
                                <textarea placeholder="请输入题目题干..." class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-primary/50" rows="4"></textarea>
                            </div>
                            
                            <div>
                                <label class="block text-sm font-medium text-muted mb-1">题目图片</label>
                                <div class="border-2 border-dashed border-gray-300 rounded-lg p-6 text-center">
                                    <i class="fa fa-cloud-upload text-3xl text-muted mb-2"></i>
                                    <p class="text-muted">点击上传图片或拖拽图片到此处</p>
                                    <button class="mt-2 px-4 py-2 bg-primary text-white rounded-lg hover:bg-primary/90 transition-colors">
                                        选择图片
                                    </button>
                                </div>
                            </div>
                        </div>
                    </div>
                    
                    <!-- 选项设置 -->
                    <div class="bg-white rounded-2xl p-6 shadow-card">
                        <h3 class="text-lg font-bold text-dark mb-6 flex items-center">
                            <i class="fa fa-list text-primary mr-2"></i>选项设置
                        </h3>
                        
                        <div class="space-y-4">
                            <div class="flex items-center space-x-4">
                                <label class="flex items-center">
                                    <input type="radio" name="correct" class="mr-2">
                                    <span class="text-sm">正确答案</span>
                                </label>
                                <button class="text-primary hover:text-primary/80">
                                    <i class="fa fa-plus"></i> 添加选项
                                </button>
                            </div>
                            
                            <div class="space-y-3">
                                <div class="flex items-center space-x-3">
                                    <span class="w-6 h-6 bg-primary/10 text-primary rounded-full flex items-center justify-center text-sm font-medium">A</span>
                                    <input type="text" placeholder="选项A" class="flex-1 px-4 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-primary/50">
                                    <button class="text-red-500 hover:text-red-600">
                                        <i class="fa fa-trash"></i>
                                    </button>
                                </div>
                                
                                <div class="flex items-center space-x-3">
                                    <span class="w-6 h-6 bg-primary/10 text-primary rounded-full flex items-center justify-center text-sm font-medium">B</span>
                                    <input type="text" placeholder="选项B" class="flex-1 px-4 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-primary/50">
                                    <button class="text-red-500 hover:text-red-600">
                                        <i class="fa fa-trash"></i>
                                    </button>
                                </div>
                                
                                <div class="flex items-center space-x-3">
                                    <span class="w-6 h-6 bg-primary/10 text-primary rounded-full flex items-center justify-center text-sm font-medium">C</span>
                                    <input type="text" placeholder="选项C" class="flex-1 px-4 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-primary/50">
                                    <button class="text-red-500 hover:text-red-600">
                                        <i class="fa fa-trash"></i>
                                    </button>
                                </div>
                                
                                <div class="flex items-center space-x-3">
                                    <span class="w-6 h-6 bg-primary/10 text-primary rounded-full flex items-center justify-center text-sm font-medium">D</span>
                                    <input type="text" placeholder="选项D" class="flex-1 px-4 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-primary/50">
                                    <button class="text-red-500 hover:text-red-600">
                                        <i class="fa fa-trash"></i>
                                    </button>
                                </div>
                            </div>
                        </div>
                    </div>
                    
                    <!-- 解析与答案 -->
                    <div class="bg-white rounded-2xl p-6 shadow-card">
                        <h3 class="text-lg font-bold text-dark mb-6 flex items-center">
                            <i class="fa fa-lightbulb-o text-primary mr-2"></i>解析与答案
                        </h3>
                        
                        <div class="space-y-4">
                            <div>
                                <label class="block text-sm font-medium text-muted mb-1">正确答案 *</label>
                                <input type="text" placeholder="请输入正确答案" class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-primary/50">
                            </div>
                            
                            <div>
                                <label class="block text-sm font-medium text-muted mb-1">解题思路</label>
                                <textarea placeholder="请输入解题思路..." class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-primary/50" rows="3"></textarea>
                            </div>
                            
                            <div>
                                <label class="block text-sm font-medium text-muted mb-1">详细解析</label>
                                <textarea placeholder="请输入详细解析..." class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-primary/50" rows="4"></textarea>
                            </div>
                        </div>
                    </div>
                </div>
                
                <!-- 右侧：辅助信息 -->
                <div class="lg:col-span-1 space-y-6">
                    <!-- 操作提示 -->
                    <div class="bg-blue-50 border border-blue-200 rounded-2xl p-6">
                        <h3 class="text-lg font-bold text-blue-800 mb-4 flex items-center">
                            <i class="fa fa-lightbulb-o text-blue-600 mr-2"></i>操作提示
                        </h3>
                        <div class="space-y-3 text-sm text-blue-700">
                            <div class="flex items-start space-x-2">
                                <i class="fa fa-check-circle mt-0.5"></i>
                                <span>题目类型确定后不可更改</span>
                            </div>
                            <div class="flex items-start space-x-2">
                                <i class="fa fa-check-circle mt-0.5"></i>
                                <span>选项数量可根据需要增减</span>
                            </div>
                            <div class="flex items-start space-x-2">
                                <i class="fa fa-check-circle mt-0.5"></i>
                                <span>支持图片、公式等富文本内容</span>
                            </div>
                            <div class="flex items-start space-x-2">
                                <i class="fa fa-check-circle mt-0.5"></i>
                                <span>标签有助于题目分类和检索</span>
                            </div>
                        </div>
                    </div>
                    
                    <!-- 快速操作 -->
                    <div class="bg-white rounded-2xl p-6 shadow-card">
                        <h3 class="text-lg font-bold text-dark mb-4 flex items-center">
                            <i class="fa fa-bolt text-primary mr-2"></i>快速操作
                        </h3>
                        <div class="space-y-3">
                            <button class="w-full px-4 py-2 bg-primary text-white rounded-lg hover:bg-primary/90 transition-colors">
                                <i class="fa fa-copy mr-2"></i>复制题目
                            </button>
                            <button class="w-full px-4 py-2 bg-white border border-gray-300 text-dark rounded-lg hover:bg-gray-50 transition-colors">
                                <i class="fa fa-upload mr-2"></i>导入题目
                            </button>
                            <button class="w-full px-4 py-2 bg-white border border-gray-300 text-dark rounded-lg hover:bg-gray-50 transition-colors">
                                <i class="fa fa-download mr-2"></i>下载模板
                            </button>
                        </div>
                    </div>
                    
                    <!-- 题目信息 -->
                    <div class="bg-white rounded-2xl p-6 shadow-card">
                        <h3 class="text-lg font-bold text-dark mb-4 flex items-center">
                            <i class="fa fa-info text-primary mr-2"></i>题目信息
                        </h3>
                        <div class="space-y-3 text-sm">
                            <div class="flex justify-between">
                                <span class="text-muted">创建时间</span>
                                <span class="text-dark">2023-12-15 15:30</span>
                            </div>
                            <div class="flex justify-between">
                                <span class="text-muted">创建者</span>
                                <span class="text-dark">张老师</span>
                            </div>
                            <div class="flex justify-between">
                                <span class="text-muted">题目ID</span>
                                <span class="text-dark">Q20231215001</span>
                            </div>
                            <div class="flex justify-between">
                                <span class="text-muted">使用次数</span>
                                <span class="text-dark">0次</span>
                            </div>
                            <div class="flex justify-between">
                                <span class="text-muted">正确率</span>
                                <span class="text-dark">-</span>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </main>

    <!-- JavaScript -->
    <script>
        document.addEventListener('DOMContentLoaded', function() {
            // 移动端菜单切换
            const mobileMenuButton = document.getElementById('mobile-menu-button');
            const sidebar = document.getElementById('sidebar');
            
            if (mobileMenuButton && sidebar) {
                mobileMenuButton.addEventListener('click', function() {
                    sidebar.classList.toggle('translate-x-0');
                    sidebar.classList.toggle('-translate-x-full');
                });
            }
            
            // 初始化移动端侧边栏状态
            function checkScreenSize() {
                if (window.innerWidth < 768) {
                    sidebar.classList.add('-translate-x-full');
                    sidebar.classList.remove('translate-x-0');
                } else {
                    sidebar.classList.remove('-translate-x-full');
                    sidebar.classList.add('translate-x-0');
                }
            }
            
            // 初始检查
            checkScreenSize();
            
            // 窗口大小变化时检查
            window.addEventListener('resize', checkScreenSize);
        });
    </script>
</body>
</html> 